********************************************************************************************
**** DESCRIPTIVE STATISTICS OF HOUSEHOLD CHARACTERISTICS AT BASELINE AND FOLLOW-UP
**** INTERACTIONS
**** This file generates output tables for group comparison at baseline using interactions. 
**** Version: 13/11/2014
********************************************************************************************

********************************************************************************************
**** INTERACTIONS WITH HOUSEHOLD STRUCTURE AND RELIGION
********************************************************************************************
		
			treattest_g $Expenditure_shares_var
				
				esttab  using "Outputs/Expenditure shares at baseline and follow-up (by household structure and religion).tex", f replace compress noobs nonumb nomtitles width(1\textwidth) gaps ///
				cells("cm_coef_c_f(fmt(3) star pvalue(cm_d_p_c_f)) ivm_coef_c_f(fmt(3) star pvalue(ivm_d_p_c_f)) Acm_coef_c_f(fmt(3) star pvalue(Acm_d_p_c_f)) Aivm_coef_c_f(fmt(3) star pvalue(Aivm_d_p_c_f)) eth_cm_coef_c_f(fmt(3) star pvalue(eth_cm_d_p_c_f)) eth_ivm_coef_c_f(fmt(3) star pvalue(eth_ivm_d_p_c_f)) eth_Acm_coef_c_f(fmt(3) star pvalue(eth_Acm_d_p_c_f)) eth_Aivm_coef_c_f(fmt(3) star pvalue(eth_Aivm_d_p_c_f))" ///
				"cm_d_se_c_f(fmt(3) par) ivm_d_se_c_f(fmt(3) par) Acm_d_se_c_f(fmt(3) par) Aivm_d_se_c_f(fmt(3) par) eth_cm_d_se_c_f(fmt(3) par) eth_ivm_d_se_c_f(fmt(3) par) eth_Acm_d_se_c_f(fmt(3) par) eth_Aivm_d_se_c_f(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6 N7 N8, layout("@ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				collabels("Diff" "Diff IV" "Diff" "Diff IV" "Diff" "Diff IV" "Diff" "Diff IV")
				
********************************************************************************************
**** INTERACTIONS WITH LOG EXPENDITURE AND MARGINAL EFFECTS
********************************************************************************************

			reg sh_food mother inter_exp ln_expenditure $controls if round == 2012, cluster(id_mun)
			est sto a
			
				reg sh_food mother##c.ln_expenditure $controls if round == 2012, cluster(id_mun)
				margins, dydx(mother) at( (p25) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p50) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p75) ln_expenditure) vce(delta)
				more
				
			
			reg sh_food mother inter_exp ln_expenditure $controls if round == 2012 & rel_muslim == 1, cluster(id_mun)
			est sto b
			
				reg sh_food mother##c.ln_expenditure $controls if round == 2012 & rel_muslim == 1, cluster(id_mun)
				margins, dydx(mother) at( (p25) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p50) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p75) ln_expenditure) vce(delta)
				more
			
			reg sh_food mother inter_exp ln_expenditure $controls if round == 2012 & rel_muslim == 0, cluster(id_mun)
			est sto c
			
				reg sh_food mother##c.ln_expenditure $controls if round == 2012 & rel_muslim == 0, cluster(id_mun)
				margins, dydx(mother) at( (p25) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p50) ln_expenditure) vce(delta)
				more
				margins, dydx(mother) at( (p75) ln_expenditure) vce(delta)
				more
			
			reg sh_food mother inter1 inter3 d1 d3 $controls if round == 2012, cluster(id_mun)
			est sto d
			
			reg sh_food mother inter1 inter3 d1 d3 $controls if round == 2012 & rel_muslim == 1, cluster(id_mun)
			est sto e
			
			reg sh_food mother inter1 inter3 d1 d3 $controls if round == 2012 & rel_muslim == 0, cluster(id_mun)
			est sto f
			
			esttab * using "Outputs/Heterogenous Food by Expenditure.tex", f replace compress nonumb nomtitles label nodepvars gaps r2 ///
			keep(mother inter_exp ln_expenditure inter1 inter3 d1 d3) ///
			order(mother inter_exp inter1 inter3 ln_expenditure d1 d3) b(3) se(3) ///
			star(* 0.1 ** 0.05 *** 0.01) collabels("OLS" "OLS" "OLS" "OLS" "OLS" "OLS")
			
			est clear
